package com.mexico.inloancash.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * Created by Eric at 2021/3/21
 */
public class IntentUtils {

    private IntentUtils() {
    }

    public static void openWeb(Context context, String url) {
        Uri uri = Uri.parse(url);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        context.startActivity(intent);
    }

    public static void openPhone(Context context, String phone) {
        Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone));
        context.startActivity(dialIntent);
    }

    public static void openEmail(Context context, String email) {
        Uri uri = Uri.parse("mailto:" + email);
        Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
        context.startActivity(intent);
    }
}
